<?php
	Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl.'/scripts/fancybox/source/jquery.fancybox.js');
	 Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl.'/scripts/fancybox/source/jquery.fancybox.css');

?>

<div class="group-products">
	<div class="name-group-product">
		<div class="name-group"><a href="#">Hàng thủ công mỹ nghệ</a></div>
		<div class="sort-by"><a href="#">Sản phẩm mới nhất</a></div>
		<div class="sort-by"><a href="#">Sản phẩm bán chạy nhất</a></div>
	</div>
	<div class="detail-products">

		<div class="one-product" >
			<img src="file_upload/PK018.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<?php $this->widget('bootstrap.widgets.BootButton', array(
			    'label'=>'Mua hàng',
			    'url'=>'#myModal',
			    'type'=>'primary',
			    'htmlOptions'=>array(
			    						'data-toggle'=>'modal',
			    						'class'=>'buy-product',
			    						'val'=>1
			    					),
			)); ?>
		</div>

		<div class="one-product">
			<a class="fancybox-thumb" rel="fancybox-thumb" href="file_upload/PK028.jpg" title="aaaaaaaa">
				<img src="file_upload/PK028.jpg" alt="" />
			</a>
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn">
				<a href="<?php echo $this->createUrl('product/view',array('url_key'=>'thanh')) ?>">
					<?php echo Yii::t('label','Xem chi tiết');?>
				</a>
			</div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

		<div class="one-product">
			<a class="fancybox-thumb" rel="fancybox-thumb" href="file_upload/PK030.jpg" title="bbbbbbb">
				<img src="file_upload/PK030.jpg" alt="" />
			</a>
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

		<div class="one-product">
			<a class="fancybox-thumb" rel="fancybox-thumb" href="file_upload/PK033.jpg" title="bbbbbbb">
				<img src="file_upload/PK033.jpg" alt="" />
			</a>

			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK063.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK068.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>


	</div>
</div>

<div class="group-products">
	<div class="name-group-product">
		<div class="name-group"><a href="#">Trang trí nội - ngoại thất</a></div>
		<div class="sort-by"><a href="#">Sản phẩm mới nhất</a></div>
		<div class="sort-by"><a href="#">Sản phẩm bán chạy nhất</a></div>
	</div>
	<div class="detail-products">

		<div class="one-product">
			<img src="file_upload/PK018.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK028.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK030.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK033.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK063.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK068.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>


	</div>
</div>


<div class="group-products">
	<div class="name-group-product">
		<div class="name-group"><a href="#">Giấy dán tường</a></div>
		<div class="sort-by"><a href="#">Sản phẩm mới nhất</a></div>
		<div class="sort-by"><a href="#">Sản phẩm bán chạy nhất</a></div>
	</div>
	<div class="detail-products">

		<div class="one-product">
			<img src="file_upload/PK018.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK028.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK030.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK033.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK063.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK068.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>


	</div>
</div>


<div class="group-products">
	<div class="name-group-product">
		<div class="name-group"><a href="#">Trà ATISO</a></div>
		<div class="sort-by"><a href="#">Sản phẩm mới nhất</a></div>
		<div class="sort-by"><a href="#">Sản phẩm bán chạy nhất</a></div>
	</div>
	<div class="detail-products">

		<div class="one-product">
			<img src="file_upload/PK018.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK028.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK030.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK033.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK063.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>

				<div class="one-product">
			<img src="file_upload/PK068.jpg" alt="">
			<div class="desc-product"><a href="#">Giấy dán tường</a></div>
			<div class="price-product btn"><?php echo Yii::t('label','Xem chi tiết');?></div>
			<button class="btn btn-primary "><?php echo Yii::t('label','Mua hàng');?></button>
		</div>


	</div>
</div>

<?php $this->beginWidget('bootstrap.widgets.BootModal', array('id'=>'myModal')); ?>

<div class="modal-header">
    <a class="close" data-dismiss="modal">&times;</a>
    <h3>Modal header</h3>
</div>

<div class="modal-body">
    <p>One fine body...</p>
</div>

<div class="modal-footer">
    <?php $this->widget('bootstrap.widgets.BootButton', array(
        'type'=>'primary',
        'label'=>'Save changes',
        'url'=>'#',
        'htmlOptions'=>array('data-dismiss'=>'modal'),
    )); ?>
    <?php $this->widget('bootstrap.widgets.BootButton', array(
        'label'=>'Close',
        'url'=>'#',
        'htmlOptions'=>array('data-dismiss'=>'modal'),
    )); ?>
</div>

<?php $this->endWidget(); ?>

<script type="text/javascript">
$(document).ready(function() {
	$(".fancybox-thumb").fancybox({
		prevEffect	: 'none',
		nextEffect	: 'none',
		helpers	: {
			title	: {
				type: 'outside'
			},
			overlay	: {
				opacity : 0.8,
				css : {
					'background-color' : '#000'
				}
			},
			thumbs	: {
				width	: 50,
				height	: 50
			}
		}
	});

	$("a.buy-product").each(function () { $(this).click(function(e) {
        console.log(this);
        e.preventDefault();
        var val=$(this).attr('val');
        datastring='val='+val;

        $.ajax
        ({
            type: "POST",
            url: "<?php  echo $this->createUrl('home/addCart');?>",
            data:datastring,
            cache: false,
            success: function(html)
            {
            }
        });

        return false;
    })});
});
</script>